



*********************************Table 16******************************************************************
*********************************Table 16******************************************************************
*********************************Table 16******************************************************************

cd "D:\Nanjing\2020\wage gap\Replication"   
use "labor-basic-tpu-reg-us-provcic98-00.dta", clear


xtset newid t
 
 gen dddprov=did*prov_cic4_usrate_mean
 gen inter_prov=post*prov_cic4_usrate_mean
  egen ind4year=group(ind4_adj  t)


****************************************
*1. columns 1 and 5 of Table 16
*---------------------------------------
preserve
 drop if export_intensity==1
 reghdfe lnabsG_gdp  dddprov  did Llnl Ltfp_op   Llnage  LlnkL  LlnRD  Lexport_intensity Lfinance2 inter_prov ///
Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind,   ///
absorb( newid t) vce(cluster ind4year)  

 eststo dddus1_1,refresh
 restore
 
 
 preserve
 drop if export_intensity==1
 reghdfe lnabs_k  dddprov  did Llnl  Ltfp_op   Llnage  LlnkL  LlnRD  Lexport_intensity Lfinance2 inter_prov ///
Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind,   ///
absorb( newid t) vce(cluster ind4year)  

 eststo dddus1_1,refresh
 restore
 
 
 
 *--------------------------------------------------------------------
 
****************************************
*2. columns 2 and 6 of Table 16
*---------------------------------------

   preserve
 drop if export_intensity==1
 reghdfe lnabsG_gdp  dddprov  did Llnl Ltfp_op   Llnage  LlnkL LlnRD  Lexport_intensity Lfinance2 inter_prov ///
Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind,   ///
absorb( newid ind4year) vce(cluster ind4year)  

eststo dddus1_2,refresh
 restore
 
 *-------------------------------------------------------------------------------------
  preserve
 drop if export_intensity==1
  winsor2 lnabs_k , replace cuts(1 99) trim
 reghdfe lnabs_k  dddprov  did Llnl Ltfp_op   Llnage  LlnkL  LlnRD   Lexport_intensity Lfinance2 inter_prov ///
Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind,   ///
absorb( newid ind4year) vce(cluster ind4year)  

eststo dddus1_2,refresh
 restore
 *-----------------------------------------------------------------------------------------------------------------
 
cd "D:\Nanjing\2020\wage gap\Replication"   
use "labor-basic-tpu-reg-us-provcic2000.dta", clear
 xtset newid t
 
 gen dddprov=did*prov_cic4_usrate  
 gen inter_prov=post*prov_cic4_usrate 
  
 egen ind4year=group(ind4_adj  t)
 

*-------------------------------------------------------------------------------------------
****************************************
*3. columns 3 and 7 of Table 16
*---------------------------------------



 preserve
 drop if export_intensity==1
 reghdfe lnabsG_gdp  dddprov  did Llnl Ltfp_op   Llnage  LlnkL LlnRD   Lexport_intensity Lfinance2  inter_prov ///
Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind,   ///
absorb( newid t) vce(cluster ind4year)  

 eststo dddus1_3,refresh
 restore
 *------------------------------------------------------------------------------------------------
 preserve
 drop if export_intensity==1
 reghdfe lnabs_k  dddprov  did Llnl Ltfp_op   Llnage  LlnkL  LlnRD   Lexport_intensity Lfinance2 inter_prov ///
Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind,   ///
absorb( newid t) vce(cluster ind4year)  

 eststo dddus1_3,refresh
 restore
 
 *------------------------------------------------------------------------------------------------------------
 
**************************************
* 4. columns 7- 8 of Table 16
*-------------------------------------*+ 
 
  preserve
 drop if export_intensity==1
 reghdfe lnabsG_gdp  dddprov  did Llnl  Ltfp_op   Llnage  LlnkL LlnRD  Lexport_intensity Lfinance2 inter_prov ///
Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind,   ///
absorb( newid ind4year) vce(cluster ind4year)  

eststo dddus1_4,refresh
 restore
 *----------------------------------------------------------------------------------------
 preserve
 drop if export_intensity==1
 reghdfe lnabs_k  dddprov  did Llnl Ltfp_op   Llnage  LlnkL LlnRD Lexport_intensity Lfinance2  inter_prov ///
Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind,   ///
absorb( newid ind4year) vce(cluster ind4year)  

eststo dddus1_4,refresh
 restore

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 ************************************Table 17***********************************************************
 ************************************Table 17***********************************************************
 ************************************Table 17***********************************************************
 
 *----------------------------------------------------
 *Part I: labor efficiency gap
 *----------------------------------------------------
 
cd "D:\Nanjing\2020\wage gap\Replication"   
use "labor-basic-tpu-reg-1.dta",clear


* xtset newid t
 egen provyear=group(province  t)
 egen ind2year=group(ind2_adj  t)
 egen owneryear=group(QiuType  t)
 egen provowneryear=group(province QiuType  t)
 
 egen ind4year=group(ind4_adj  t)


gen lnabsG_gdp=ln(absG_gdp)

winsor2 tfp_op lnabsG_gdp lnage  finance2  lnkL rate , replace cuts(1 99) trim
winsor2 lnRD, replace cuts(0 99) trim
drop if VMPL<0

replace tpu3_ind=log(tpu3)
replace did=post*tpu_ind

*---------------------------------------------------------------------------------------------------
* 17.1 column 1:
reghdfe lnabsG_gdp  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(t newid) cluster (ind4year)   

*---------------------------------------------------------------------------------------------------
*17.2 column 2:
reghdfe lnabsG_gdp  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provyear newid) cluster (ind4year)   
*---------------------------------------------------------------------------------------------------
*17.3 column 3:
reghdfe lnabsG_gdp  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear newid) cluster (ind4year)   

*---------------------------------------------------------------------------------------------------
*17.4 column 4:
reghdfe lnabsG_gdp  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear provyear newid) cluster (ind4year)   

*---------------------------------------------------------------------------------------------------
*17.5 column 5:
reghdfe lnabsG_gdp  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provowneryear newid) cluster (ind4year)   



**************************************************************************************************************
 *----------------------------------------------------
 *Part II: capital efficiency gap
 *----------------------------------------------------
 
 
 
cd "D:\Nanjing\2020\wage gap\Replication"   
use "labor-basic-tpu-reg-1.dta",clear
gen VMPK=capitale*(y_ind_add1/k)

drop if VMPK<0

/*
* distribution of VMPK
twoway (kdensity VMPK if VMPK<5.3, color(red)),  xtitle(VMPK) ytitle(Distribution)
graph export "D:\Nanjing\2020\wage gap\RR\results\VMPK_dist.eps",replace
*/


*1. generate capital category:
bysort id: gen indc_n=_n==1
gen m_k=k if indc_n==1
bysort id: egen M_k=max(m_k)

egen p1=pctile(M_k), p(25)
egen p2=pctile(M_k), p(50)
egen p3=pctile(M_k), p(75)
gen size_k=0
replace size_k=1 if M_k<=p1
replace size_k=2 if M_k>p1&M_k<p2
replace size_k=3 if M_k>p2&M_k<p3
replace size_k=4 if M_k>p3

 bysort t indc: egen agg_l=sum(n)
 gen l_s=n/agg_l
replace did=post*tpu_ind
 
*2. generate average rental rate in each category:
bysort city ind4_adj QiuType size_k t: egen r_rate=sum(l_s*VMPK) if inv>0
*bysort county ind4_adj QiuType size_k t: egen r_rate=mean(VMPK) if inv>0


* 3. gap measured in capital:

gen gdp_def=1
replace gdp_def=1.077 if t==1999
replace gdp_def=1.077*1.085 if t==2000
replace gdp_def=1.077*1.085*1.083 if t==2001
replace gdp_def=1.077*1.085*1.083*1.091 if t==2002
replace gdp_def=1.077*1.085*1.083*1.091*1.10 if t==2003
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201 if t==2004
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201*1.114 if t==2005
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201*1.114*1.127 if t==2006
replace gdp_def=1.077*1.085*1.083*1.091*1.10*1.201*1.114*1.127*1.142 if t==2007

/*
gen gdp_def=1
replace gdp_def=1.063 if t==1999
replace gdp_def=1.177 if t==2000
replace gdp_def=1.302 if t==2001
replace gdp_def=1.428 if t==2002
replace gdp_def=1.819 if t==2003
replace gdp_def=1.899 if t==2004
replace gdp_def=2.198 if t==2005
replace gdp_def=2.575 if t==2006
replace gdp_def=3.170 if t==2007
*/

gen gap_k=VMPK-r_rate
gen abs_G_k=abs(gap_k)
gen lnabs_k=log(abs_G_k)


 egen provyear=group(province  t)
 egen ind2year=group(ind2_adj  t)
 egen owneryear=group(QiuType  t)
 egen provowneryear=group(province QiuType  t)
 egen ind4year=group(ind4_adj  t)

 *-----------------------------------------------------
 ******************************************** 
 * for Table 3 in the updates  (Columns 5-8)
 ********************************************
 *------------------------------------------------------

*17.6 column 6:


reghdfe lnabs_k  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(t newid) cluster (ind4year)   
 
*---------------------------------------------------------------------------------------

*17.7 column 7:

reghdfe lnabs_k  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provyear newid) cluster (ind4year)   
 
*---------------------------------------------------------------------------------------


*17.8 column 8:

reghdfe lnabs_k  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear newid) cluster (ind4year)   

*---------------------------------------------------------------------------------------

*17.9. column 9:

reghdfe lnabs_k  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(owneryear provyear newid) cluster (ind4year)   

*---------------------------------------------------------------------------------------

*17.10 column 10:

reghdfe lnabs_k  did  Llnl Ltfp_op   Llnage  LlnkL  LlnRD    export_intensity Lfinance2 ///
 Ltariff_input Ltariff_output post_kl_1998 Lhhi5_lns_ind Llnk_ind ,  ///
absorb(provowneryear newid) cluster (ind4year)   


 
 
 
 
